#ifndef _NE_PRIMITIVE_DECLARATION_H_
#define _NE_PRIMITIVE_DECLARATION_H_

#include <mathematics/Matrix4.h>
#include <graphics/VertexData.h>
#include <graphics/IndexData.h>

namespace ne
{
    class NEAPI PrimitiveDeclaration
    {
        public:
            PrimitiveDeclaration();

            void setTransformMatrix(const Matrix4 &m);
            const Matrix4& getTransformMatrix() const;

            void setPrimitiveType(const PrimitiveType pt);
            PrimitiveType getPrimitiveType() const;

            uint32_t getVertexCount() const;

            bool hasVertexAttribute(const AttributeSemantic semantic) const;
            VertexAttributePtr getVertexAttribute(const AttributeSemantic semantic) const;
            bool addVertexAttribute(const VertexAttributePtr &pAttribute);
            uint32_t getVertexAttributeCount() const;
            const VertexAttributeMap& getVertexAttributeMap() const;

            bool hasIndexAttribute() const;
            bool addIndexAttribute(const VertexAttributePtr &pAttribute);
            uint32_t getIndexAttributeCount() const;
            const VertexAttributeList& getIndexAttributeList() const;

            void removeAllVertexAttribute();
            void removeAllIndexAttribute();
            void removeAll();

            ~PrimitiveDeclaration();

        private:
            PrimitiveDeclaration(const PrimitiveDeclaration &);

            PrimitiveDeclaration& operator = (const PrimitiveDeclaration &);


        private:
            Matrix4 mTransformMatrix;
            PrimitiveType mPrimitiveType;
            VertexAttributeMap mVertexAttributeMap;
            VertexAttributeList mIndexAttributeList;
    };

    typedef SharedPtr<PrimitiveDeclaration> PrimitiveDeclarationPtr;
}

#endif
